The present invention relates to requesting services of a processor of a computer, and more particularly to a system and method for servicing requests using an activity indicator in order to reduce process overhead.
Computers typically include several subsystems that perform one or more predetermined functions, such as functions associated with data transfer, communications, data processing, etc. It is often desired to inform a computer""s processor or central processing unit (CPU) to perform processing associated with one or more of the subsystem functions. Many such functions are repetitive and occur relatively often, so that the CPU may be interrupted relatively often by the same subsystem. Since CPU technology has advanced significantly, the CPU was usually able to respond and complete the interrupt task before another interrupt by the same subsystem. Technology associated with many subsystems, however, has also advanced so that the CPU may be interrupted again by the same subsystem logic that the CPU is currently servicing. When the CPU is executing a driver in response to an interrupt by a subsystem, another interrupt by that same subsystem causes the CPU to waste valuable processor time responding to redundant interrupts.
One exemplary subsystem is network communications such as performed by a network adapter card or network interface controller (NIC). Using such adapters or controllers, computers and other devices may be networked together using any one of several available architectures and any one of several corresponding and compatible network protocols. A common network architecture is Ethernet(trademark), such as the 10Base-T Standard operating at 10 Megabits per second (Mbps) and 100Base-TX Ethernet(trademark) Standard operating at 100 Mbps according to the IEEE Standard 802.3. A newer Ethernet(trademark) architecture operating at 1 Gigabit per second (Gbps) is available and becoming more prominent for server systems. The present invention is illustrated using the Ethernet(trademark) architecture which may be used with TCP/IP (Transmission Control Protocol/Internet Protocol), which is a common network protocol particularly for the Internet. The present invention, however, is not limited to any particular network protocol or architecture. In fact, although the present invention is illustrated using network type communication systems, it is not limited to network communications and may be applied to any type of subsystem of a computer.
The primary function of a network adapter is to transfer data to and from system memory of the computer system, although the network adapter may perform many other network functions. A network may have its own processor or processing logic, but many network functions may still require processing by the CPU or may require CPU notification. For example, in many configurations, a network adapter informs the CPU after every network packet is received before Direct Memory Access (DMA) circuitry or the like on the network adapter transfers the data to the system memory. After transferring data from the network to the computer system memory, the computer CPU may be needed to process the transferred data in the system memory. In a similar manner, when data is transferred from the system memory to the network adapter or asserted onto the network, the network adapter may inform the CPU that the transfer has completed.
A driver or interrupt service routine (ISR) that corresponds to the network adapter is loaded into the memory and executed by the processor or CPU in response to interrupts by the network adapter. The network adapter sends an interrupt to the CPU after each packet is received, so that the CPU executes the driver or ISR in response to each interrupt. While the CPU is executing the driver in response to an interrupt from a network adapter in response to a received packet, another packet may be received by the same network adapter, which asserts another interrupt. The CPU responds to the new interrupt wasting valuable processing time and causing significant delay. Such delays cause inefficiency of the subsystem, which may affect the overall performance of the computer system.
One or more computers in a network configuration may operate as servers for other computers and devices in the network. Often, the other computers and devices rely on the server(s) for information, storage, access to databases, programs, other networks, etc., and various other services. It is desired to improve network processing between a network adapter and its host computer for any computer coupled to a network. This is particularly true when the computer operates as a server on the network. It is desired that each server operate as efficiently as possible and to provide as much data bandwidth as possible, especially during periods of heavy demand and increased network traffic. More generally, it is desired to improve the efficiency of processing associated with any type of subsystem of a computer.
A service request system for a subsystem of a computer includes a processor, a driver, and inhibit logic that detects requests for service by the subsystem and that asserts an interrupt unless the driver is executing and servicing the subsystem. The driver is executed by the processor in response to the interrupt to service the subsystem, where the driver controls the inhibit logic to prevent interrupts associated with the subsystem from being asserted while the driver is being executed by the processor. In this manner, redundant interrupts or service requests initiated by the subsystem are eliminated thereby avoiding unnecessary processing overhead associated with handling such redundant interrupts or service requests.
The service request system may include an activity indicator that indicates whether the driver is being executed. The inhibit logic asserts an interrupt in response to a request by the subsystem unless the driver is executing as indicated by the activity indicator. Also, the driver controls the activity indicator to prevent redundant interrupts associated with the subsystem. In another embodiment, the subsystem detects the activity indicator and inhibits requesting service while the activity indicator indicates that the driver is being executed by the processor. In this latter case, the subsystem avoids wasting time associated with requesting service. Further, the subsystem may be operated in a more streamlined mode while the driver is in control of the processor.
In one embodiment, the activity indicator is a logic bit that indicates whether the driver is executing. The driver changes the state of the logic bit upon execution to a first state and changes the state of the logic bit to a second state upon exiting. For example, an xe2x80x9cinactivexe2x80x9d bit is cleared by the driver upon execution and set by the driver when exiting execution.
A computer system according to one embodiment of the present invention includes at least one peripheral bus, a disk drive and corresponding disk drive controller, a processor, a system memory, a subsystem, and a subsystem driver. The subsystem includes subsystem logic that requests service from the processor and interrupt logic that selectively asserts an interrupt in response to requests for service from the subsystem logic. The subsystem driver is executed by the processor from the system memory in response to an interrupt from the subsystem interrupt logic. The subsystem driver controls the subsystem interrupt logic to prevent interrupts associated with the subsystem logic while the subsystem driver is being executed by the processor.
In one embodiment, the subsystem is coupled to the processor via the peripheral bus. For example, the subsystem may be implemented on a network interface card (NIC) that is plugged into a slot of the peripheral bus. In this case, the subsystem logic may comprise network logic on the NIC that performs network functions for coupling the computer system to a network, and the driver may comprise a NIC driver for handling requests for service by the NIC. In this case, redundant interrupts from the NIC are avoided while the NIC driver is servicing the NIC.
The computer system may include system interrupt logic that receives interrupts for the processor, that interrupts the processor for each interrupt received and that informs the processor of the source of each received interrupt. The computer system may further include an activity indicator, where the subsystem interrupt logic selectively asserts an interrupt in response to a request from the subsystem logic based on the activity indicator. The subsystem driver controls the activity indicator to prevent interrupts associated with the subsystem logic while the subsystem driver is being executed by the processor. In a more particular embodiment, the activity indicator is a logic bit (such as an xe2x80x9cactivexe2x80x9d bit, an xe2x80x9cinactivexe2x80x9d bit, an xe2x80x9cactivityxe2x80x9d bit, etc.) that indicates whether the subsystem driver is being executed by the processor. In this latter case, the subsystem driver changes the logic bit to a first state during initial execution and changes the logic bit to a second state prior to exiting execution. For an inactive bit representing whether the driver is being executed (active, logic zero) or not being executed (inactive, logic one), the subsystem driver clears the inactive bit upon execution and sets the bit just before exiting.
A method of handling service requests for a processor of a computer according to one embodiment of the present invention includes detecting a service request, selectively asserting a corresponding interrupt in response to the service request based on the status of an activity indicator, executing a driver in response to an interrupt, and controlling, by the driver, the activity indicator to prevent further interrupts while the driver is being executed and to enable interrupts while the driver is not being executed. The activity indicator may comprise an activity bit, where the selectively asserting a corresponding interrupt includes asserting an interrupt if the activity indicator is in a first logic state, and inhibiting an interrupt if the activity indicator is in a second logic state. The method may further include setting, by the driver, the activity bit during execution and clearing, by the driver, the activity bit prior to exiting execution. For a computer that includes subsystem logic that requests service, the method further may further include selectively requesting service, by the subsystem logic, based on the status of the activity indicator.
It is now appreciated that a system and method using an activity indicator to reduce processing overhead according to the present invention reduces process overhead associated with redundant interrupts and/or service requests. A system and method according to the present invention is advantageous for any computer in which a subsystem may potentially assert an interrupt while its own driver or interrupt service routine is already in control of the system processor. The driver associated with a subsystem handles one or more serviceable functions or events while in control of the system processor, so that the processor need not spend valuable processing time responding to any redundant interrupts or requests. Such redundant requests are avoided, thereby improving overall system efficiency by eliminating unnecessary process overhead.
A network controller system with interrupt inhibits according to the present invention improves network processing between a network adapter or NIC and its host computer by eliminating redundant interrupts from the NIC. Such a network controller system is particularly useful on network server systems. Data flow between the network adapter and host computer memory, for example, is processed much more quickly, thereby significantly increasing bandwidth and improving network traffic flow.